home *** CD-ROM | disk | FTP | other *** search
Java Source | 2003-04-29 | 2.4 KB | 79 lines |
- // Skeleton class generated by rmic, do not edit.
- // Contents subject to change without notice.
-
- package com.jproxy.samples.rmi.test;
-
- public final class TestImpl_Skel
- implements java.rmi.server.Skeleton
- {
- private static final java.rmi.server.Operation[] operations = {
- new java.rmi.server.Operation("byte echoBytes(byte[])[]"),
- new java.rmi.server.Operation("long getServerTime()")
- };
-
- private static final long interfaceHash = 3274809350234753702L;
-
- public java.rmi.server.Operation[] getOperations() {
- return (java.rmi.server.Operation[]) operations.clone();
- }
-
- public void dispatch(java.rmi.Remote obj, java.rmi.server.RemoteCall call, int opnum, long hash)
- throws java.lang.Exception
- {
- if (opnum < 0) {
- if (hash == -3791006001307315080L) {
- opnum = 0;
- } else if (hash == 7800110265884817733L) {
- opnum = 1;
- } else {
- throw new java.rmi.UnmarshalException("invalid method hash");
- }
- } else {
- if (hash != interfaceHash)
- throw new java.rmi.server.SkeletonMismatchException("interface hash mismatch");
- }
-
- com.jproxy.samples.rmi.test.TestImpl server = (com.jproxy.samples.rmi.test.TestImpl) obj;
- switch (opnum) {
- case 0: // echoBytes(byte[])
- {
- byte[] $param_arrayOf_byte_1;
- try {
- java.io.ObjectInput in = call.getInputStream();
- $param_arrayOf_byte_1 = (byte[]) in.readObject();
- } catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- } catch (java.lang.ClassNotFoundException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling arguments", e);
- } finally {
- call.releaseInputStream();
- }
- byte[] $result = server.echoBytes($param_arrayOf_byte_1);
- try {
- java.io.ObjectOutput out = call.getResultStream(true);
- out.writeObject($result);
- } catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling return", e);
- }
- break;
- }
-
- case 1: // getServerTime()
- {
- call.releaseInputStream();
- long $result = server.getServerTime();
- try {
- java.io.ObjectOutput out = call.getResultStream(true);
- out.writeLong($result);
- } catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling return", e);
- }
- break;
- }
-
- default:
- throw new java.rmi.UnmarshalException("invalid method number");
- }
- }
- }
-